<?php
/*
 * Created on Dec 2, 2010
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
class CouponDomain
{
	private $id;
	private $merchantId;
	
	private $code;
	
	private $name;
	private $filteredName;
	
	private $descript;
	
	private $trackingURL;	
	private $trackingHtmlCode;
	private $impressionpixel;
	
	private $startDate;
	private $endDate;
	
	private $sourceId;
	
	private $costType;	// 0:unknown, 1:CPA, 2:CPC, 3:CPM
	private $creativeType;
	
	private $status;
	
	private $isFeatured;
	private $isRecommend;
	
	private $r_sortValue;
	
	private $oMerchant;
	private $oCouponImage;
	
	private $oAttributes;
	private $oComments;
	
	private $oCategory;
	private $oVote;
	
	
	public function CouponDomain()
	{
	}
	
	public function setId($id)
	{
		$this->id = $id;
	}
	
	public function getId()
	{
		return $this->id;
	}
	
	public function setMerchantId($merchantId)
	{
		$this->merchantId = $merchantId;
	}
	
	public function getMerchantId()
	{
		return $this->merchantId;
	}
	
	public function setDescript($descript)
	{
		$this->descript = $descript;
	}
	
	public function getDescript()
	{
		return $this->descript;
	}
	
	public function setCode($code)
	{
		$this->code = $code;
	}
	
	public function getCode()
	{
		return $this->code;
	}
	
	public function setName($name)
	{
		$this->name = $name;
	}
	
	public function getName()
	{
		return $this->name;
	}
	
	public function setFilteredName($filteredname)
	{
		$this->filteredname = $filteredname;
	}
	
	public function getFilteredName()
	{
		return $this->filteredname;
	}
	
	public function setTrackingURL($trackingURL)
	{
		$this->trackingURL = $trackingURL;
	}
	
	public function getTrackingURL()
	{
		return $this->trackingURL;
	}
	
	public function setStartDate($startDate)
	{
		$this->startDate = $startDate;
	}
	
	public function getStartDate()
	{
		return $this->startDate;
	}
	
	public function setEndDate($endDate)
	{
		$this->endDate = $endDate;
	}
	
	public function getEndDate()
	{
		return $this->endDate;
	}
	
	public function setTrackingHtmlCode($trackingHtmlCode)
	{
		$this->trackingHtmlCode = $trackingHtmlCode;
	}
	
	public function getTrackingHtmlCode()
	{
		return $this->trackingHtmlCode;
	}
	
	public function setImpressionpixel($impressionpixel)
	{
		$this->impressionpixel = $impressionpixel;
	}
	
	public function getImpressionpixel()
	{
		return $this->impressionpixel;
	}	
	
	public function setSourceId($sourceId)
	{
		$this->sourceId = $sourceId;
	}
	
	public function getSourceId()
	{
		return $this->sourceId;
	}
	
	public function setCreativeType($creativeType)
	{
		$this->creativeType = $creativeType;
	}

	public function setCostType($costType)
	{
		$this->costType = $costType;
	}
		
	public function setIsFeatured($isFeatured)
	{
		$this->isFeatured = $isFeatured;
	}

	public function setIsRecommend($isRecommend)
	{
		$this->isRecommend = $isRecommend;
	}
		
	public function getCreativeType()
	{
		return $this->creativeType;
	}

	public function getCostType()
	{
		return $this->costType;
	}

	public function getIsFeatured()
	{
		return $this->isFeatured;
	}

	public function getIsRecommend()
	{
		return $this->isRecommend;
	}
	
	public function setMerchant($oMerchant)
	{
		$this->oMerchant = $oMerchant;
	}
	
	public function getMerchant()
	{
		return $this->oMerchant;
	}
	
	public function setCouponImage($oCouponImage)
	{
		$this->oCouponImage = $oCouponImage;
	}
	
	public function getCouponImage()
	{
		return $this->oCouponImage;
	}
	
	public function setAttributes($oAttributes)
	{
		$this->oAttributes = $oAttributes;
	}
	
	public function getAttributes()
	{
		return $this->oAttributes;
	}
	
	public function setComments($oComments)
	{
		$this->oComments = $oComments;
	}
	
	public function getComments()
	{
		return $this->oComments;
	}
	
	public function setStatus($status)
	{
		$this->status = $status;
	}
	
	public function getStatus()
	{
		return $this->status;
	}
	
	public function setRsortValue($r_sortValue)
	{
		$this->r_sortValue = $r_sortValue;
	}
	
	public function getRsortValue()
	{
		return $this->r_sortValue;
	}
	
	
	public function getAttributeValue($attributeId)
	{
		if(is_object($this->oAttributes[$attributeId])){
			return $this->oAttributes[$attributeId]->getAttributeValue();
		}else
			return '';
	}
	
	public function getPromotionType()
	{
		if(is_array($this->oAttributes)){
			foreach($this->oAttributes as $oAttribute){
				if($oAttribute->getAttributeValue() == 'Promo Type' && $oAttribute->getAttributeName() != 'Unspecified')
					return $oAttribute->getAttributeName();
			}
		}
		
		return '';
	}
	
	public function getMailto()
	{
		return "subject=I%27ve%20shared%20a%20" . rawurlencode($this->oMerchant->getName()) . "%20coupon%20with%20you%20from%20www.hohobb.com!&amp;body=" . rawurlencode($this->oMerchant->getName()) . "%20Coupon%3A%20" . rawurlencode($this->name) . "%0D%0A%0D%0AShare%20URL%3A%20http%3A%2F%2Fwww.hohobb.com%2F" . $this->oMerchant->getNameId() . "-coupon-codes%2F" . $this->id;
	}
	
	public function getShareFacebook($homeURL)
	{
		return "http://www.facebook.com/sharer.php?u=" . rawurlencode("$homeURL/" . $this->oMerchant->getNameId() . "-coupon-codes/") . $this->id . "&t=" . rawurlencode($this->oMerchant->getName() . ' coupon code: ' . $this->name);
	}
	
	public function getShareTwitter($homeURL)
	{
		return "http://twitter.com/intent/tweet?url=" . rawurlencode("$homeURL/" . $this->oMerchant->getNameId() . "-coupon-codes/") . $this->id . "&text=" . rawurlencode($this->oMerchant->getName() . ' coupon code: ' . $this->name);
	}
	
	public function setCategory($oCategory)
	{
		$this->oCategory = $oCategory;
	}
	
	public function getCategory()
	{
		return $this->oCategory;
	}
	
	public function setVote($oVote)
	{
		$this->oVote = $oVote;
	}
	
	public function getVote()
	{
		return $this->oVote;
	}
}
?>
